<h3>Creating Meeting for Group: <%= @group.name %></h3>


<% form_remote_tag (:url => {:action => 'add_meeting', :group_id => @group.id}, :html => {:id => 'this_form'}) do  %>

<fieldset><legend><strong>Meeting Information</strong></legend>
<div style="float:none;clear:both">
<span class="cell">
	<label>Select Event Type:</label><br>
	<%= collection_select('event_type', 'id', EventType.find(:all), 'id', 'name') %>
</span>

<%= observe_field 'event_type_id',
 				:url => {:action => 'event_type_changed'},
				:update => 'instance_types_drop_down',
				:with => 'id' %>

<% @event_type = EventType.find(:first) %>
<span class="cell" id ="instance_types_drop_down">
	<%= render :partial => "select_instance_type", :locals => {:event_type => @event_type} %>
</span>

<span class="cell">
	<label>Choose Date:</label><br>
	<%= date_field 'meeting', 'real_date', :format => '%d %b %Y', :size => 20 %>
</span>

<br>
</div>

<div style="float:none;clear:both;">
<label>Comments:</label><br>
<%= text_area 'meeting', 'comments', :rows => 3, :cols => 50 %>
</div></fieldset><br>


<fieldset><legend><strong>Attendance Information</strong></legend>
<input type='submit' value='Check All' onClick="$$('#this_form input.check').each(function(box){box.checked=true});return false;" />
<input type='submit' value='Uncheck All' onClick="$$('#this_form input.check').each(function(box){box.checked=false});return false;" />

<% @group.enrollments.each do |e| %>
	<div id="person_id_<%= e.person.id %>">
		<span id="checkbox_id_<%= e.person.id %>">
		<%= check_box_tag 'present_people[]', e.person.id, {}, :class => 'check' %></span>
		<%= e.person.full_name %>
	</div>
<% end %>
</fieldset><br>

<%= submit_tag 'Create Meeting' %>
<% end %>

<%= link_to_remote 'cancel', :url => {:action => 'cancel_new_meeting', :id => @group } %>
